<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Notes</title>
    <script class="javascript" src="chrome://footbar/content/sort.js"></script>
    <script type="text/javascript">
        var oXslDom=[];
        var oXmlDomTypes=[];
        //Based on http://www.developer.com/xml/article.php/3630526
        function loadXML(url){
            var httpRequest;
            httpRequest = new XMLHttpRequest();
            httpRequest.overrideMimeType('text/xml');
            httpRequest.open('GET', url, false);
            httpRequest.send(null);
            return httpRequest.responseXML;
        }

        function init(){
            //XSL Stylesheets
            oXslDom['single']=loadXML("chrome://footbar/content/xml/notes.xsl");
            //FilePath
            oXmlDomTypes['single']="chrome://footbar/content/xml/notes.xml";
            execute('single');
        }

        function execute(mode){
            var oXmlDom=loadXML(oXmlDomTypes[mode]);

            var oProcessor = new XSLTProcessor()
            oProcessor.importStylesheet(oXslDom[mode]);
            var oResultDom = oProcessor.transformToDocument(oXmlDom);

            var serializer = new XMLSerializer();
            var oDiv=document.getElementById('divResult');
            var returnValue=serializer.serializeToString(oResultDom);
            oDiv.innerHTML=unescapeXML(returnValue);
        }
        function unescapeXML(str){
            str = str.replace(/&lt;/g, '<');
            str = str.replace(/&gt;/g, '>');
            str = str.replace(/&amp;/g, '&');
            str = str.replace(/CDATA_START;/g,'<![CDATA');
            str = str.replace(/CDATA_END;/g, ']]>');
            return str;
        }
    </script>

    <style type="text/css">
        body{
            background:#FFFFFF;
        }
        #trucoder-header{
            font-family:"Trebuchet MS";
            padding:5px;
            border:1px solid #666666;
            background-color: #F9F9F0;
            border:1px dotted #E0E0E0;
            padding: 20px;
        }

        #trucoder-header h1{
            color: #33CC00;
            font: bold 1.2em Arial, Verdana, Helvetica, Sans-serif;
            margin : 0;
            padding: 0;
        }
        #trucoder-header-description{
            color:#666666;
        }
    </style>

</head>
<body>

<div id="divResult">&nbsp;</div>
<script>
    init();
</script>

</body>
</html>
